<link href="${rc.getContextPath()}/manage/css/dwzCustomCss/dwz.custom.css?v=${ver}" rel="stylesheet" type="text/css">

<div class="pageContent" id="jGridForUserWarehouse"></div>

<script type="text/javascript">
(function($){
    
    var flagFunction=function(data)
    {
        if (data == 0) {
            return '<@label    key="no.C">否</@label>';
        } else if (data == 1) {
            return '<@label    key="yes.C">是</@label>';
        }
    };
    var flagOption=[
         {value: '', label: '<@label key="all.C">所有</@label>'},
         {value: 0, label: '<@label key="no.C">否</@label>'},
         {value: 1, label: '<@label key="yes.C">是</@label>'}
        ];
    var moveTypeOption=[
            {value: '', label:'<@label key="all.C">所有</@label>'},
                        <#if moveTypes??&&(moveTypes?size) gt 0>
                            <#list moveTypes as mt>
                                {value: '${mt.moveTypeCode}', label: '${mt.moveTypeCode}-${mt.moveTypeText}'},
                            </#list>
                        </#if>
                   ];
    $('#jGridForUserWarehouse').jGrid({
        layoutH: 165,
        base: '${rc.getContextPath()}/manage/userWarehouse/',
        url: 'selectUserWarehouseList',
        columns: [
            {field: 'userCode;warehouseCode', group: 'ids', type: 'checkbox', width: 22},
            {field: '_index', text: '<@label key="serialNumber.C">序号</@label>', width: 40},
            {field: 'userCode', text: '<@label key="userCode.C">用户编号</@label>', width: 100, query: true,orderTable:'u'},
            {field: 'warehouseCode', text: '<@label key="WarehouseCode.C">仓库编号</@label>', width: 100, query: true,orderTable:'w'},
            {field: 'warehouseText', text: '<@label key="WarehouseText.C">仓库描述</@label>', width: 100, query: true,orderTable:'w',orderTable:'w'},
            {field: 'warehouseTypeCode', text: '<@label key="WarehouseTypeCode.C">仓库类型编号</@label>', width: 100, query: true,orderTable:'wt'},
            {field: 'warehouseTypeText', text: '<@label key="WarehouseTypeText.C">仓库类型描述</@label>', width    : 100, query: true,orderTable:'wt'},
        ],
        query:{
            queryfields:[
                {field: 'moveTypeCode', text: '<@label key="moveTypeCode.C">移动类型描述</@label>', orderTable:'mt',query: true,type: 'select', options:moveTypeOption}
            ]
        },
        gridbars: [
            {icon: 'add', text: '<@label key="add.B">新增</@label>', title: '<@label key="addUserWarehouse.D">新增仓库权限</@label>', 
                target: 'dialog', href: 'addUserWarehouse', data: {navTabId: "${navTabId!''}"}, mask: true, width: 650, height: 490, rel: '', 
                menuCode: "UserWarehouse_add"},
            {icon: 'edit', text: '<@label key="edit.B">编辑</@label>', title: "<@label key='editUserWarehouse.D'>编辑仓库权限</@label>", 
                target: 'dialog', href: 'editUserWarehouse', data: {userCode: '{userCode}', warehouseCode: '{warehouseCode}',navTabId: '${navTabId!""}'}, mask: true, width: 650, height: 500, rel: '', callback: $.noop,
                menuCode: "UserWarehouse_edit"},
            {icon: 'icon', text: '<@label key="view.B">详情</@label>', title: "<@label key='viewUserWarehouse.D'>仓库权限详情</@label>", 
                target: 'dialog', href: 'viewUserWarehouse', data: {userCode: '{userCode}', warehouseCode: '{warehouseCode}', navTabId: '${navTabId!""}'}, mask: true, width: 650, height: 500, rel: '', callback: $.noop,
                menuCode: "UserWarehouse_view"},
            {icon: 'delete', text: '<@label key="delete.B">删除</@label>', title: "<@label key='confirmDelUserWarehouse.M'>确认要删除选择的仓库权限吗？</@label>", 
                target: 'selectedTodo', href: 'deleteUserWarehouse', data: {ids: '{ids}', navTabId: '${navTabId!""}'},
                menuCode: "UserWarehouse_del"}
        ]
    });
})(jQuery);
</script>